<template>
	<view class="authentication u-skeleton">
		<u-navbar title="实名认证" :background="{
			'backgroundColor':'#fff'
		}" :borderBottom="false" class="u-skeleton-rect"></u-navbar>
		<view class="title">手机号</view>
		<view class="box">
			<input placeholder="请输入手机号" v-model="info.mobile"/>
		</view>
		<view class="title">姓名</view>
		<view class="box">
			<input placeholder="请输入真实姓名" v-model="info.realname"/>
		</view>
		<view class="title">身份证号</view>
		<view class="box">
			<input placeholder="请输入身份证号" v-model="info.idcardno"/>
		</view>
		<u-button class="btn-primary u-skeleton-rect" @click="btn" ripple-bg-color="rgba(0,0,0,.4)" :ripple="true">确定</u-button>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				info:{
					mobile:'',
					idcardno:'',
					realname:''
				}
			}
		},
		onLoad(option) {

		},
		onShow() {
			this.getinfo();
		},
		methods: {
			//获取当前个人数据
			getinfo() {
				this.$http.asyncSendrequest({
					url: '/profile/userInfo',
					success: res => {
						this.info = res.data;
					}
				})
			},
			//确认实名
			btn(){
				this.$http.asyncSendrequest({
					url: '/profile/authMember',
					data:{
						...this.info
					},
					success: res => {
						this.$util.taost({
							title:res.msg,
							callback:v=>{
								if(res.code == '0'){
									uni.navigateBack({delta:1})
								}
							}
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.authentication {
		min-height: 100vh;
		background-color: #FFFFFF;

		.title {
			margin: 30rpx;
			font-size: 26rpx;
		}

		.box {
			display: flex;
			align-items: center;
			margin: 0 30rpx;
			background: var(--bg-project);
			border-radius: 6rpx;
			height: 90rpx;
			display: flex;
			align-items: center;
			padding: 0 30rpx;
			box-sizing: border-box;
			input{
				font-size: 26rpx;
				width: 100%;
			}
		}
	}

	.btn-primary {
		height: 96rpx;
		background: #292929;
		border-radius: 10rpx;
		text-align: center;
		line-height: 96rpx;
		font-size: 26rpx;
		font-family: PingFang SC;
		color: #FFFFFF;
		margin-top: 116rpx;
		position: fixed;
		bottom: 20rpx;
		left: 30rpx;
		width: calc(100% - 60rpx);
	}
</style>